//package com.telit.firecommand.service.impl;
//
//import cn.hutool.core.date.DateUtil;
//import com.telit.android.dto.GeoPkFdiRdAreaDto;
//import com.telit.common.annotation.cache.BaseCache;
//import com.telit.firecommand.dao.CommForestryConditionsDao;
//import com.telit.firecommand.dto.VisualRightDTO;
//import com.telit.firecommand.service.CommForestryConditionService;
//import com.telit.firecommand.vo.CommForestryConditionsVO;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.math.BigDecimal;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * Create by Chencf 2023/02/17
// */
//@Service
//public class CommForestryConditionServiceImpl implements CommForestryConditionService {
//    @Autowired
//    private CommForestryConditionsDao commForestryConditionsDao;
//
//
//    @Override
//    @BaseCache(params = {"#districtCode"})
//    public CommForestryConditionsVO findConditionsByDistrictCode(String districtCode) {
//
////        if (StringUtils.isNotBlank(districtCode)) {
////            districtCode = districtCode + "%";
////        }
//        CommForestryConditionsVO conditionsByDistrictCode = commForestryConditionsDao.findConditionsByDistrictCode(districtCode);
//        return conditionsByDistrictCode;
//    }
//
//    @Override
//    public int countUav(String districtCode) {
//
//        if (StringUtils.isNotBlank(districtCode)) {
//            districtCode = districtCode + "%";
//        }
//        int countUav = commForestryConditionsDao.countUav(districtCode);
//        return countUav;
//    }
//
//    @Override
//    public List<GeoPkFdiRdAreaDto> statisticAreaByDJ(VisualRightDTO dto) {
//        Integer codeLength = 0;
//        String dateFormatStr = DateUtil.format(DateUtil.parse(dto.getDate()), "yyyyMMdd");
//        if (StringUtils.isNotBlank(dto.getDistrictCode())) {
//           codeLength=dto.getDistrictCode().length();
//        }
//        if (StringUtils.isNotBlank(dto.getDistrictCode())){
//            dto.setDistrictCode(dto.getDistrictCode()+"%");
//        }
//        List<GeoPkFdiRdAreaDto> geoPkFdiRdAreaDtos=new ArrayList<>();
//        if (codeLength==2){
//          geoPkFdiRdAreaDtos = commForestryConditionsDao.statisticAreaByDJ2(dateFormatStr, dto.getDistrictCode());
//        }else if (codeLength==4){
//             geoPkFdiRdAreaDtos = commForestryConditionsDao.statisticAreaByDJ3(dateFormatStr, dto.getDistrictCode());
//        }else if (codeLength==6){
//            geoPkFdiRdAreaDtos = commForestryConditionsDao.statisticAreaByDJ4(dateFormatStr, dto.getDistrictCode());
//        }else if (codeLength==9){
//            geoPkFdiRdAreaDtos = commForestryConditionsDao.statisticAreaByDJ4(dateFormatStr, dto.getDistrictCode());
//        }
//
//        return geoPkFdiRdAreaDtos;
//    }
//
//    @Override
//    public BigDecimal cameraScope(String districtCode) {
//        BigDecimal bigDecimal = commForestryConditionsDao.cameraScope(districtCode);
//        return bigDecimal;
//    }
//
//}
